<?php

/**
 * Creates a call for the method `yii\db\Migration::createTable()`.
 */
/* @var $fields array the fields */
/* @var $foreignKeys array the foreign keys */

?>
        $tableOptions = null;
        if ($this->db->driverName === 'mysql') {
            $tableOptions = 'CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci ENGINE=InnoDB COMMENT="table_comment_placeholder"';
        }

        $this->createTable(self::TABLE_NAME, [
<?php foreach ($fields as $field):
    if (empty($field['decorators'])): ?>
            '<?= $field['property'] ?>',
<?php else: ?>
            <?= "'{$field['property']}' => \$this->{$field['decorators']}" ?>,
<?php endif;
endforeach; ?>

            'created_at' => $this->dateTime()->notNull()->comment('创建日期'),
            'updated_at' => $this->dateTime()->defaultValue(null)->comment('上次更新'),
        ], $tableOptions);
<?= $this->render('_addForeignKeys', [
    'foreignKeys' => $foreignKeys,
]);
